import { RoomType, RoomStatus } from '../../../types/room';
import type { Room, RoomAvailability } from '../../../types/room';

// Canvas 单元格位置接口
export interface CellPosition {
  x: number;
  y: number;
  width: number;
  height: number;
  roomId: string;
  month: string;
}

// 选中的单元格接口
export interface SelectedCell {
  roomId: string;
  month: string;
}

// Canvas 尺寸配置接口
export interface CanvasSize {
  width: number;
  height: number;
  cellWidth: number;
  cellHeight: number;
  headerHeight: number;
  roomNumberWidth: number;
  buildingWidth: number;
}

// 房间状态样式接口
export interface RoomStatusStyle {
  backgroundColor: string;
  textColor: string;
  borderColor: string;
  text: string;
}

// 甘特图配置接口
export interface GanttConfig {
  months: string[];
  cellWidth: number;
  cellHeight: number;
  headerHeight: number;
  roomNumberWidth: number;
  buildingWidth: number;
  colors: {
    available: RoomStatusStyle;
    booked: RoomStatusStyle;
    partiallyBooked: RoomStatusStyle;
    maintenance: RoomStatusStyle;
    selected: RoomStatusStyle;
  };
}

// 甘特图事件回调接口
export interface GanttEventCallbacks {
  onRoomSelect?: (roomId: string, month: string) => void;
  onNewOrder?: (roomId: string, month: string) => void;
  onRoomTypeChange?: (roomType: RoomType) => void;
}

// 甘特图数据接口
export interface GanttData {
  rooms: Room[];
  availabilities: RoomAvailability[];
}

// 甘特图状态接口
export interface GanttState {
  selectedRoomType: RoomType;
  selectedCell: SelectedCell | null;
  isLoading: boolean;
  error: string | null;
}

// 甘特图操作接口
export interface GanttActions {
  setSelectedRoomType: (roomType: RoomType) => void;
  setSelectedCell: (cell: SelectedCell | null) => void;
  setLoading: (loading: boolean) => void;
  setError: (error: string | null) => void;
}

// 虚拟化滚动配置接口
export interface VirtualScrollConfig {
  itemHeight: number;
  containerHeight: number;
  overscan: number;
  threshold: number;
}

// 性能监控接口
export interface PerformanceMetrics {
  renderTime: number;
  memoryUsage: number;
  fps: number;
  domNodes: number;
}

// 导出所有类型
export type { Room, RoomAvailability, RoomType, RoomStatus };
